my_list = ["hello", "python", "hello", "itcast", "hello"]

# my_list.append("黑马")
# print(my_list)
# my_list.pop(-1)
# print(my_list)
# my_list[-1]= 'chuanzhi'
# print(my_list)
# n=my_list[1]
# print(n)
# jishu=my_list.count('hello')
# print(jishu)
# print(len(my_list))


# info = {'name':'mike', 'age':35, 'city':'sz'}
# info['sex']='man'
# print(info)
# info.pop('sex')
# print(info)
# info['age']=18
# print(info)
# a=info['name']
# print(a)

# for 循环计算字符串 'a-bc-12----3' 中有多少个字符'-'
"""
for 临时变量 in range(循环次数):
    循环体
注意事项: 循环是从 0 开始的
"""
str = 'a-bc-12----3'
i = 0
for n in str:  #字符串
    if n == '-':
        i += 2
print(i)

